From a3a4c50f26b8750ae1c87f1f1103b84b7d2e6315 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 14 Nov 2023 15:11:22 +0100
Subject: refactor(components): replace LinksListWidget with LinksWidget

* avoid List component repeat
* rewrite tests and CSS
* add an id to LinksWidgetItemData (previously LinksListItems) type
because the label could be duplicated
---
 src/pages/sujet/[slug].tsx | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'src/pages/sujet/[slug].tsx')

diff --git a/src/pages/sujet/[slug].tsx b/src/pages/sujet/[slug].tsx
index 66c3d02..d841b73 100644
--- a/src/pages/sujet/[slug].tsx
+++ b/src/pages/sujet/[slug].tsx
@@ -9,7 +9,7 @@ import { useIntl } from 'react-intl';
 import {
   getLayout,
   Heading,
-  LinksListWidget,
+  LinksWidget,
   type MetaItemData,
   PageLayout,
   PostsList,
@@ -25,7 +25,7 @@ import styles from '../../styles/pages/blog.module.scss';
 import type { NextPageWithLayout, PageLink, Topic } from '../../types';
 import { ROUTES } from '../../utils/constants';
 import {
-  getLinksListItems,
+  getLinksItemData,
   getPageLinkFromRawData,
   getPostsWithUrl,
   getSchemaJson,
@@ -185,23 +185,23 @@ const TopicPage: NextPageWithLayout<TopicPageProps> = ({
         widgets={
           thematics
             ? [
-                <LinksListWidget
+                <LinksWidget
                   heading={
                     <Heading isFake level={3}>
                       {thematicsListTitle}
                     </Heading>
                   }
-                  items={getLinksListItems(thematics)}
+                  items={getLinksItemData(thematics)}
                   // eslint-disable-next-line react/jsx-no-literals -- Key allowed
                   key="related-thematics"
                 />,
-                <LinksListWidget
+                <LinksWidget
                   heading={
                     <Heading isFake level={3}>
                       {topicsListTitle}
                     </Heading>
                   }
-                  items={getLinksListItems(topics)}
+                  items={getLinksItemData(topics)}
                   // eslint-disable-next-line react/jsx-no-literals -- Key allowed
                   key="topics"
                 />,
-- 
cgit v1.2.3

